
package OraConnectionData;

import java.sql.*;

public class OraConnectionData
{   
	public OraConnectionData()
	{
		m_oraDriver = "oracle.jdbc.driver.OracleDriver";
		m_oraHost = "localhost:1521";
		m_oraSID = "XE";
		m_oraURL = "jdbc:oracle:empire@" + m_oraHost;
		m_oraUser = "empire";
		m_oraPassword = "empire";
		
		
	}
	
	public String getHost(){ return m_oraHost; }
	public String getSID() { return m_oraSID; }
	public String getURL() { return m_oraURL; }
	public String getUser() { return m_oraUser; }
	public String getPassword() { return m_oraPassword; }
	public String getDriver() { return m_oraDriver; }
	public Connection getConnection() throws SQLException
	{
		 m_oraConn = DriverManager.getConnection(m_oraURL, m_oraUser, m_oraPassword);
		 return m_oraConn;
	}
	public String closeConnection()
	{
		try
		{
			m_oraConn.close();
			return "";
		}
		catch( SQLException sqlE )
		{
			return sqlE.getMessage();
		}
		catch ( Exception e )
		{
			return e.getMessage();
		}
	}

	
	private String m_oraDriver;
	private	String m_oraHost;
	private	String m_oraSID;
	private	String m_oraURL;
	private	String m_oraUser;
	private	String m_oraPassword;
	
	private Connection m_oraConn;

}